import 'package:boss/ui/page/staff/page/staffDetail/staff_detail_page.dart';
import 'package:boss/ui/page/staff/widget/staff_browser.dart';
import 'package:boss/ui/widget/center_title_app_bar.dart';
import 'package:boss/ui/widget/label_button.dart';
import 'package:flutter/material.dart';
import 'package:hi_common/hi_common.dart';
import 'package:router/annotation.dart';

@RouterConfig(StaffPage.pageName)
class StaffPage extends StatefulWidget {
  static const String pageName = '/staffPage';

  @override
  StaffPageState createState() => StaffPageState('员工');

  StaffPage({Key key}) : super(key: key);
}

class StaffPageState extends BaseState<StaffPage> {
  StaffPageState(String pageName) : super(pageName);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CenterTitleAppBar(
        title: '员工管理',
        actions: <Widget>[
          LabelButton(
            title: '+新增员工',
            padding: EdgeInsets.only(left: 8, top: 2, bottom: 2),
            onTap: () {
              Navigator.pushNamed(context, StaffDetailPage.pageName);
            },
          ),
        ],
      ),
      body: StaffBrowser(),
    );
  }
}
